package com.xm.servlet.background.commodity;

import com.xm.service.background.CommodityDetailsService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 修改商品详细视频
 * @author 康文程
 * @date 2024-1-19 下午 02:04
 */
@WebServlet("/background/update/commodity/details/video")
public class UpdateCommodityDetailsVideoServlet extends HttpServlet {
    private final CommodityDetailsService service = new CommodityDetailsService();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html;charset=utf-8");
        String commodityId = req.getParameter("commodityId");
        String detailsVideo = req.getParameter("detailsVideo");
        resp.getWriter().print(service.updateDetailsVideoByCommodityId(Integer.parseInt(commodityId),detailsVideo));
    }
}
